<?php
header ("Content-Type:text/html; charset= utf-8");
if(empty($_GET['channel_id'])){
	echo "forbidden";
	exit();
}
require_once ('config.php');
require_once (WEBSITEURL.'/'.ADMINLOC.'/article_page_list_templates.php');
require_once (WEBSITEURL.'/'.ADMINLOC.'/channel_templates.php');
require_once (WEBSITEURL.'/'.ADMINLOC.'/channel_list_templates.php');
require_once (WEBSITEURL.'/'.ADMINLOC.'/image_article_list_templates.php');
require_once (WEBSITEURL.'/'.ADMINLOC.'/article_list_templates.php');
$channel_id=$_GET['channel_id'];
$offset=0;
if(isset($_GET['offset'])){
	$offset=$_GET['offset'];
}
$system=new System();
$sys_style=$system->getSysStyle();
$channel_model=basename($system->getChannelModel($channel_id));
if($channel_model==""||(!file_exists(WEBSITEURL."/templates/$sys_style/channel/$channel_model"))){
	$channel_model="default.htm";
};
$smarty->template_dir=WEBSITEURL."/templates/$sys_style/channel";
$smarty->assign("template_dir","templates/$sys_style");
$smarty->assign("channel_id",$channel_id);
$smarty->assign("offset",$offset);
$smarty->registerPlugin("block","channel","channel"); //注册block
$smarty->registerPlugin("block","arclist","arclist"); //注册block
$smarty->registerPlugin("block","channellist","channellist"); //注册block
$smarty->registerPlugin("block","arcpagelist","arcpagelist"); //注册block
$smarty->registerPlugin("block","imgarclist","imgarclist"); //注册block
$smarty->display($channel_model,md5("channel".$channel_model));
//$smarty->display("index.htm");